<?php

class Controller_Maintemplate extends Controller_Template {
	public $template = 'template';
	
	public function before() {
		parent::before();
		if($this->auto_render) {
			$categories = Model::factory('category')
				->where('parent_category_id', '=', 0)
				->find_all();
			$this->template->categories = $categories;
			$this->template->search = View::factory('search');
			$this->template->search->set('categories', $categories);
			
			$this->template->title = 'Title Placeholder';
			$this->template->content = 'Body Placeholder';
			$this->template->styles = array();
			$this->template->scripts = array();
		}
	}
	/*
	public function after()
	{
		if ($this->auto_render)
		{
			$styles = array(
					'media/css/screen.css' => 'screen, projection',
					'media/css/print.css' => 'print',
					'media/css/style.css' => 'screen',
			);
	
			$scripts = array(
					'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js',
			);
	
			$this->template->styles = array_merge( $this->template->styles, $styles );
			$this->template->scripts = array_merge( $this->template->scripts, $scripts );
		}
		parent::after();
	}
	*/
}